﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Box.Entities;

namespace Box.Repository.Mapping
{
    public class PagosMap:EntityTypeConfiguration<Pagos>
    {
        public PagosMap()
        {
            this.HasKey(p => p.Id);
            this.Property(p => p.Id)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            this.Property(p => p.FechaPago)
                .IsRequired();

            this.Property(p => p.ImagenPago);

            this.ToTable("PAGOS");

            this.Property(p => p.Id).HasColumnName("Id");
            this.Property(p => p.FechaPago).HasColumnName("FechaPago");
            this.Property(p => p.ImagenPago).HasColumnName("ImagenPago");

            this.HasRequired(p => p.Proveedor)
                .WithMany()
                .WillCascadeOnDelete(false);




        }
    }
}
